Skip to content

Fix #6263: Register needsStaging when creating a synthetic quoted type #6342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 24, 2019

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki marked this pull request as ready for review April 19, 2019 18:00
def quotedType(t: Type) = {
if (StagingContext.level == 0)
ctx.compilationUnit.needsStaging = true // We will need to run ReifyQuotes
ref(defn.InternalQuoted_typeQuote).appliedToType(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if implicit search is the best place to put the logic --- what about put the logic in typer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We detect quotes and splices when we type. The issue here is that we will do not type this tree because we create it already typed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern I have here is about modularity. It seems the added code does not belong here. Is it due to concern about performance? Modularity could be sacrificed for performance.

Now that these methods are not wrongly tagged as macros the top level quote needs to be reified.

See tests/pos/quoted-inline-quote.scala
@liufengyun
Copy link
Contributor

test performance please

@dottybot
Copy link
Member

performance test scheduled: 2 job(s) in queue, 1 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/6342/ to see the changes.

Benchmarks is based on merging with master (2a033aa)

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicolasstucki nicolasstucki merged commit f691a18 into scala:master Apr 24, 2019
@nicolasstucki nicolasstucki deleted the fix-#6263 branch April 24, 2019 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants